<% @page_title = 'Signup' %>

<div id="content">
	<h2 class="title">Account Signup</h2>
	
	
	<%= render :partial => 'shared/notice_text', :locals => {:flash => flash} %>

	<form action="/account/signup" method="post" id="signup-form">
			<% if not @invite.nil? %>
			<input type="hidden" name="invite_id" value="<%= @invite.id %>" />
			Please complete the following form to signup.	&nbsp;&nbsp;The person who invited you (<i><%= @invite.user.first_name %></i>) will automagically be added to your friends list.
		<% end %>

		<center>
		<div id="signupform" class="form" style="margin-right: 100px;">
					
			<%= error_messages_for 'user' %><br/>

			<table cellspacing="2" cellpadding="2" width="400px">
				<tr>
					<td><label for="user_login">Username:</label></td>
					<td>
						<%= text_field "user", "login", :size => 14, :maxlength => 20,	:class => 'validate-alphanum nice-field required' %>	 
					</td>
				</tr>
				<tr>
					<td>
						<input type="hidden" name="dummy" class="validate-match" />
						<label for="user_password">Password:</label></td>
					<td>
						<%= password_field "user", "password", :size => 10, :maxlength => 15, :class => 'nice-field required' %>
					</td>
				</tr>
				<tr>
					<td><label for="user_password_confirmation">Password (confirm):</label></td>
					<td>
						<%= password_field "user", "password_confirmation", :size => 10, :maxlength => 15, :class => 'nice-field required' %>
					</td>
				</tr>
				<tr><td colspan="2">
					<input type="checkbox" name="ageverify" value="yes" class="validate-is-checked" /> I am at least 13 years old.
				</td></tr>
				<tr>
					<td colspan="2" class="submit_button"><input type="Submit" value="Create Account" class="submit-box"></td>
				</tr>
			</table>
		</div>
		</center>
	</form>

	<ul><b>Signup Notes</b>
		<li>cookies are required to signup and login</li>
		<li>since we only collect your username and <i>never</i> your email address, there is <i>absolutely no way</i> for you to recover your password if you ever forget it or lose it</li>
		<li>thus if you cannot easily remember your password, it is highly recommended you use software like <a href="http://passwordsafe.sourceforge.net/" target="_blank">Password Safe</a> to store your passwords securely</li>
	</ul>

</div>

<script type="text/javascript">
  is_checked = function(value, element) {
    return element.checked;
  }
	passwords_must_match = function(value, element) {
		return ($('user_password_confirmation').value == $('user_password').value)
	}

  new Validation('signup-form');
  Validation.add('validate-is-checked', 'You must agree to this in order to signup.', is_checked);
  Validation.add('validate-match', 'Passwords entered do not match.', passwords_must_match);
</script>

